package com.example.workshop.lesson7;

import com.example.workshop.lesson7.Filter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
public class RecommenderImplementation {
    private Filter filter;

    //构造函数引入

    @Autowired
    public RecommenderImplementation(@Qualifier("contentBasedFilter")Filter filter) {
        super();
        this. filter= filter;
        System.out.println("构造函数已参与");
    }

    public String [] recommendMovies(String movie){
        //打印正在使用的接口名称
        System.out.println("打印正在使用的Filter是："+filter+"\n");

       String results[]= filter.getRecommendations("流浪地球");

       return results;
    }
}
